package behaviors;


import lejos.nxt.LCD;
import lejos.nxt.Motor;
import lejos.robotics.subsumption.Behavior;
import model.SBOne;


public class FollowLine implements Behavior {
	private boolean suppressed= false;
	private  SBOne f_SBOne;
	
	public FollowLine(){
		super();
		f_SBOne = SBOne.getInstance();
	}
	
	@Override
	public boolean takeControl() {		
		LCD.drawString("FL TC " + f_SBOne.getColorID(), 0, 0);
		if(f_SBOne.getColorID() == 0 && (!f_SBOne.isFindDirection()))// 0 == RED
			return true;
		return false;
	}

	@Override
	public void action() {
		LCD.drawString("FL AC", 0, 1);
		f_SBOne.forward();
	}
	
	@Override
	public void suppress() {
		LCD.drawString("FL SP", 0, 2);
		suppressed = true;
	}


}
